package com.markerhub.common.enums;

/**
 * @description:
 * @projectName: vueadmin-java
 * @author: zhouhaizhi
 * @createTime: 2021/9/18 16:22
 * @version:1.0
 */
public enum SmsTypeEnums {

    DX("DX", "电信"),
    YD("YD","移动"),
    LT("LT","联通"),
    QT("QT","其它"),
    HW("HW", "海外");

    private String code;

    private String name;

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    SmsTypeEnums(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static SmsTypeEnums getUserStatusByCode(String code) {
        SmsTypeEnums[] arr = SmsTypeEnums.values();
        for (SmsTypeEnums smsTypeEnums : arr) {
            if (smsTypeEnums.getCode().equals(code)) {
                return smsTypeEnums;
            }
        }
        return null;
    }

    public static String getNameByCode(String code){
        SmsTypeEnums smsTypeEnums = getUserStatusByCode(code);
        if (null != smsTypeEnums) {
            return smsTypeEnums.getName();
        }
        return null;
    }
}
